#ifndef _BUOLA_SCENE_GEODES_CPOINTCLOUD_H_
#define _BUOLA_SCENE_GEODES_CPOINTCLOUD_H_

#include <buola/scene.h>
#include <buola/scene/cobject.h>
#include <buola/algorithm/container.h>
#include <buola/cv/ccloud.h>
#include <buola/scene/cvertexdata.h>
#include <buola/scene/techniques/cpointtechnique.h>
#include <buola/scene/techniques/cpointntechnique.h>

namespace buola { namespace scene {

class CPointCloud : public CObject
{
public:
    CPointCloud();
    CPointCloud(cvi::CCloud_rgb8 &&pCloud);
    ~CPointCloud();

    void SetCloud(cvi::CCloud_rgb8 &&pCloud);
    void SetCloud(cvi::CCloud_n_rgb8 &&pCloud);
    
    virtual void Render(CRenderContext &pContext);

private:
    void GenerateData();
    
    std::unique_ptr<cvi::CCloud_rgb8> mCloud;
    std::unique_ptr<cvi::CCloud_n_rgb8> mCloudN;

    CVertexData mVertexData;
    int mPointCount;
    bool mHaveData;
    CPointTechnique *mTechnique;
    CPointNTechnique *mTechniqueN;
};

typedef intrusive_ptr<CPointCloud> PPointCloud;

/*namespace scene*/ } /*namespace buola*/ }

#endif
